package com.young.core.manager;

import com.young.common.query.Pagination;
import com.young.common.query.Query;
import com.young.core.domain.ProjectDO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * name: ProjectManager
 *
 * @author zhaoxinbo
 * @Description
 * @Date create in 2020/9/21 14:29.
 */
public interface ProjectManager {

    /**
     * 添加项目
     * @param project
     */
    @Transactional
    void insert(ProjectDO project);

    /**
     * 修改项目
     * @param project
     */
    @Transactional
    void update(ProjectDO project);

    @Transactional
    void audit(int id, boolean auditable);

    /**
     * 根据projectId查询项目信息
     * @param id 项目ID
     * @param include
     * @return
     */
    ProjectDO get(int id, boolean include);


    /**
     * 根据project查询项目信息
     * @param name
     * @param include
     * @return
     */
    ProjectDO get(String name, boolean include);

    Pagination<ProjectDO> query(Query query);

    List<ProjectDO> search(String pattern);

    @Transactional
    int delete(String name);
}
